<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

class CreateGpsadvAdvers extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('gpsadv_advers', function (Blueprint $table) {
            $table->increments('id')->comment('ID');
            $table->Integer('user_id')->comment('用户ID');
            $table->string('title',255)->default("")->comment('广告标题@sometimes|required|unique:gpsadv_advers,title');
            $table->timestamp('expire_start_time')->default(NULL)->comment('广告开始时间@sometimes|required|unique:gpsadv_advers,expire_start_time');
            $table->timestamp('expire_end_time')->default(NULL)->comment('广告结束时间@sometimes|required|unique:gpsadv_advers,expire_end_time');
            $table->string('banner_img',255)->default("")->comment('广告图片@sometimes|required|unique:gpsadv_advers,banner_img');
            $table->string('advers_url',255)->default("")->comment('广告跳转地址@sometimes|required|unique:gpsadv_advers,advers_url');
            $table->timestamps();
            $table->softDeletes();

                       $table->charset = config('database.connections.'.config('database.default').'.charset').
                ' COMMENT="手机广告表$softDeletes,timestamps"';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('gpsadv_advers');
    }
}
